package com.pan;

import com.pan.analyzer.Analyzer;
import com.pan.analyzer.AnsjAnalyzer;
import com.pan.analyzer.WordAnalyzer;
import com.pan.clean.TxtCleaner;
import com.pan.reader.TxtFilesReader;
import com.pan.util.PathUtil;
import com.pan.util.PrintUtil;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.util.List;


@Slf4j
public class AnalyzerStarter {

  public static void main(String[] args) {
    //
    String path = PathUtil.getChineseAnalyzerFilePath("TheForteenthFiveYearPlan.txt");
    TxtFilesReader txtFilesReader = new TxtFilesReader();
    try {
      List<String> fileLines = txtFilesReader.readFile(path);
      TxtCleaner txtCleaner = new TxtCleaner();
      List<String>  cleanSentences = txtCleaner.cleanUnnessarySpace(fileLines);
      Analyzer wordAnalyzer = new AnsjAnalyzer();
      wordAnalyzer.getWordCount(cleanSentences);
    } catch (IOException e) {
      e.printStackTrace();
    }


  }

}
